﻿using System;
using System.Collections.Generic;
using System.Dto;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace System.IBLL
{
    public interface ISystemManager
    {
        /// <summary>
        /// 通过角色ID获取到该角色所对应的菜单列表
        /// </summary>
        /// <param name="RoleId">用户ID</param>
        /// <returns></returns>
        List<Menuslists> GetMenuslists(int RoleId);
        /// <summary>
        /// 获取到所有的菜单的信息，分页获取
        /// </summary>
        /// <param name="limit">条数</param>
        /// <param name="page">页数</param>
        /// <param name="title">菜单名筛选</param>
        /// <param name="pid">父ID筛选</param>
        /// <param name="datalet">out 总条数</param>
        /// <returns></returns>
        List<AllMenusListDto> GetAllMenusList(int limit, int page, string title, string pid, out int datalet);
        /// <summary>
        /// 获取到菜单所有数据
        /// </summary>
        /// <returns></returns>
        List<AllMenusListDto> GetAllData();
        /// <summary>
        /// 父ID下拉表格选择器的数据，返回ID和Title
        /// </summary>
        /// <param name="limit">条数</param>
        /// <param name="page">页数</param>
        /// <param name="keyword">筛选条件</param>
        /// <param name="datalet">out 总条数</param>
        /// <returns></returns>
        List<(int Id, string Title)> GettableSelectList(int limit, int page, string keyword, out int datalet);
        /// <summary>
        /// 通过ID查找某一条菜单数据信息
        /// </summary>
        /// <param name="Id">菜单id</param>
        /// <returns></returns>
        AllMenusListDto GetOneMenusById(int Id);
        /// <summary>
        /// 添加一条菜单
        /// </summary>
        /// <param name="Menus">数据模型</param>
        /// <returns></returns>
        Task AddNewMnus(AddMenusDto Menus);
        /// <summary>
        /// 修改一条菜单信息
        /// </summary>
        /// <param name="listDto">数据模型</param>
        /// <returns></returns>
        Task EditOneMenus(AllMenusListDto listDto);
        /// <summary>
        /// 分页获取日志信息
        /// </summary>
        /// <param name="limit">条数</param>
        /// <param name="page">页数</param>
        /// <param name="LogTitle">日志信息筛选</param>
        /// <param name="StaffName">操作人筛选</param>
        /// <param name="datalet">out 总条数</param>
        /// <returns></returns>
        List<LogListDto> GetAllLogList(int limit, int page,string LogTitle,string StaffName,out int datalet);
        /// <summary>
        /// 添加日志信息
        /// </summary>
        /// <param name="SettingType">日志类型</param>
        /// <param name="SettingText">日志内容</param>
        /// <param name="SettingName">操作人</param>
        /// <returns></returns>
        Task AddLogs(string SettingType, string SettingText, string SettingName="卢俊宇");
        /// <summary>
        /// 通过ID删除菜单
        /// </summary>
        /// <param name="id">菜单ID</param>
        /// <returns></returns>
        Task DelMenusById(int id);
        /// <summary>
        /// 分页获取所有员工的信息，返回给员工页面的表格中
        /// </summary>
        /// <param name="limit">条数</param>
        /// <param name="page">页数</param>
        /// <param name="StaffName">员工名筛选</param>
        /// <param name="Sex">性别筛选</param>
        /// <param name="DepartmentRoleId">角色名筛选</param>
        /// <param name="datalet">总条数</param>
        /// <returns></returns>
        List<StaffListDto> GetAllStaffList(int limit,int page,string StaffName,string Sex,string DepartmentRoleId, out int datalet);
        /// <summary>
        /// 获取下拉框的角色表数据
        /// </summary>
        /// <param name="limit">条数</param>
        /// <param name="page">页数</param>
        /// <param name="DepartmentRoleName">角色名筛选</param>
        /// <param name="datalet">总条数</param>
        /// <returns></returns>
        List<(int Id, string DepartmentRoleName)> GettableSelectStaffList(int limit, int page, string DepartmentRoleName, out int datalet);
        /// <summary>
        /// 添加一条员工数据
        /// </summary>
        /// <param name="StaffName">员工名</param>
        /// <param name="PassWord">密码</param>
        /// <param name="Sex">性别</param>
        /// <param name="DepartmentRoleId">角色ID</param>
        /// <param name="Wages">工资</param>
        /// <returns></returns>
        Task AddNewStaff(string StaffName, string PassWord, string Sex, int DepartmentRoleId, string Wages);
        /// <summary>
        /// 通过ID删除员工信息
        /// </summary>
        /// <param name="id">员工ID</param>
        /// <returns></returns>
        Task DelStaffById(int id);
        /// <summary>
        /// 编辑页面通过ID获取到特定的员工信息
        /// </summary>
        /// <param name="Id">员工ID</param>
        /// <returns></returns>
        AllStaffListDto GetOneStaffById(int Id);
        /// <summary>
        /// 修改页面后保存修改信息
        /// </summary>
        /// <param name="listDto">数据模型</param>
        /// <returns></returns>
        Task EditOneStaff(AllStaffListDto listDto);
        /// <summary>
        /// 获取角色表数据
        /// </summary>
        /// <param name="limit">条数</param>
        /// <param name="page">页数</param>
        /// <param name="DepartmentRoleName">角色名筛选</param>
        /// <param name="datalet">数据总长度</param>
        /// <returns></returns>
        List<AllDepartmentRoleListDto> GetAllDepartmentRoleList(int limit, int page, string DepartmentRoleName, out int datalet);
        /// <summary>
        /// 获取到所有菜单及角色ID所拥有的菜单并汇总返回
        /// </summary>
        /// <param name="id">角色ID</param>
        /// <returns></returns>
        List<MenusToDepartmentRoleDto> GitDepartmentRoleToMenus(int id);
        /// <summary>
        /// 给角色分配权限   先删除原有的，重新添加选中的
        /// </summary>
        /// <param name="id">角色ID</param>
        /// <param name="like">选中的菜单ID集</param>
        /// <param name="DepartmentRoleName">角色名</param>
        /// <returns></returns>
        Task AssignPermissions(int id, string like, string DepartmentRoleName);
        /// <summary>
        /// 添加角色页面tableselect下拉选择器数据接口
        /// </summary>
        /// <param name="limit">条数</param>
        /// <param name="page">页数</param>
        /// <param name="MenusName">菜单名筛选</param>
        /// <param name="datalet">数据总长度</param>
        /// <returns></returns>
        List<GetMenusListToTableSelect> GetMenusListToSelects(int limit, int page, string MenusName, out int datalet);
        /// <summary>
        /// 添加一条角色信息
        /// </summary>
        /// <param name="Name">角色名</param>
        /// <param name="Remark">备注</param>
        /// <returns></returns>
        Task AddNewDeparTmentRole(string Name, string Remark);
        /// <summary>
        /// 通过角色名获取到角色名对应的ID   后面带修改成由时间排序获取第一个
        /// </summary>
        /// <param name="Name"></param>
        /// <returns></returns>
        int GetDepartmentRoleIdByName(string Name);
        /// <summary>
        /// 通过角色ID删除角色数据的接口定义
        /// </summary>
        /// <param name="id">角色ID</param>
        /// <returns></returns>
        Task DelDepartmentRoleById(int id);
        //List<Menuslists> buildMenuChild(List<Menus> menus);
        AllDepartmentRoleListDto GetOneDepartmentRoleById(int id);

        Task EditDepartmentRoleByDto(AllDepartmentRoleListDto dto);

    }
}
